Introduction to Statistics C

Maria Anastasiadi

2025-04-25

Statistical Foundations Part3

Other Types of ANOVA

Introduction


  • The ANOVA examples we have considered so far in the course are one-way ANOVA since they involve only one factor, e.g. fibre type or wheat cultivar.

  • If for the Bioaccessibility example we had considered two factors—e.g. fibre type AND food matrix type we would have to use something called a two-way ANOVA.

Bioaccesibility Experiment

Interaction effect


A two-way ANOVA on data from the Bioaccessibility experiment would tell us whether Bioaccessibility was affected by:


▪️ Fibre Type –> Main Effect

▪️ Food Type –> Main Effect

▪️ Fibre/Food combination –> The Interaction Effect

Interaction effect

The interaction effect tells us whether the effect of Fibre depends on Food Type (and vice versa).


Two-Way ANOVA R syntax

bioaccess.anova<-aov(Bioaccessibility~Fibre*Food, data=bioaccess)

Two-way ANOVA Assumptions

Post-Hoc Tests

If the interactions effect is significant we can do multiple comparison tests.

For example: TukeyHSD(biaccess.anova)

Results

Nested ANOVA

▪️ The two factors in the two-way ANOVA design are known as factorial:

▪️ We have every combination of every level of each factor.

▪️ If the levels of one of the factors appear in only one level of the other factors we have nested factors

Nested factors


  • If levels of factor B appear in only one of the levels in factor A, factor B is termed nested within factor A.

  • To symbolise that factor B is nested with A we write B(A).

  • Nested designs are quite common in ecology and environmental sciences.

Example of Nested Design


▪ We conduct an experiment to test the soil pH in Agricultural vs Industrial land.

▪ We have the factor Treatment with 2 levels (Agricultural and Industrial).

▪ We have 4 areas nested within each treatment and 5 soil samples in each area.

Nested ANOVA in R

▪ The previous design is nested because an area cannot belong to both the Agricultural and the Industrial group.

nested.anova <- aov(pH ~ Treatment + Area %in% Treatment, data = pH.soil)
summary(nested.anova)
##                Df Sum Sq Mean Sq F value Pr(>F)  
## Treatment       1  5.417   5.417   6.831 0.0143 *
## Treatment:Area  5  5.702   1.140   1.438 0.2416  
## Residuals      28 22.204   0.793                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

p>0.05 for the nested factor –> the pH variance within areas in the same group is small.

Fundamental ANOVA assumptions


1. The population from which samples are drawn should be normally distributed.

2. Homogeneity of variance: Homogeneity means that the variance among the groups should be approximately equal.

3. Independence of cases: the sample cases should be independent of each other.

Repeated Measures ANOVA


▪️ A study design with repeated measures data has multiple dependent variable observations collected at several time points.

▪️ This design violates the samples independence assumption.

▪️ For time course experiments we can use a repeated measures ANOVA.

▪️ A repeated measures ANOVA accounts for the correlation within and between experimental groups along with the time of the measurements (time point 1, time point 2, …).

ANOVA and Repeated Measures ANOVA Summary